import { createWebHashHistory, createRouter } from 'vue-router';

const globRes = import.meta.glob('@/pages/**/*.ts', { eager: true }) as any;

console.log(globRes);

const children = Object.keys(globRes).map((key) => {
  const route = globRes[key].default;
  return route;
});
console.log('children == ',children);
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      name: 'home',
      children,
    },
  ],
});

export default router;
